<template>
  <view class="view">
    <view>token: {{ token }}</view>
    <u-button @click="setToken('345')">设置</u-button>
    <GlobalTips ref="globalTips" />
  </view>
</template>

<script lang="ts">
import { Component, Mixins } from 'vue-property-decorator'
import tipsMixin from '@/mixins/tipsMixin'
import { Getter, namespace } from 'vuex-class'
const user = namespace('user')

@Component
export default class Vuex extends Mixins(tipsMixin) {
  @user.Mutation setToken: any
  @Getter token!: string

  onLoad() {
    this.setToken('123')
  }
}
</script>

<style lang="scss" scoped>
</style>
